#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
##---------------------------------------------------------------------------##
##
## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2010 Skomoroh
## Copyright (C) 20010 Jeremy Austin-Bardo
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
##---------------------------------------------------------------------------##

from ...gamelib import info as gi
import __common__ as Puzzle

GT, SL = gi.GT, gi.SL

class Pegged(Puzzle.PeggedGame):
    __info__ = dict(id=180, name="Pegged", game_type=GT.PUZZLE_TYPE, version='4.30')
    STEPS = ((-4, 0), (4, 0), (0, -4), (0, 4))
    ROWS = [3, 5] + [7]*3 + [5, 3]


class PeggedCross7(Pegged):
    __info__ = dict(id=181, name="Pegged Cross 1", game_type=GT.PUZZLE_TYPE, version='4.30')
    ROWS = [3]*2+[7]*3+[3]*2


class PeggedCross9(PeggedCross7):
    __info__ = dict(id=182, name="Pegged Cross 2", game_type=GT.PUZZLE_TYPE, version='4.30')
    ROWS = [3]*3+[9]*3+[3]*3


class Pegged6x6(Pegged):
    __info__ = dict(id=183, name="Pegged 6x6", game_type=GT.PUZZLE_TYPE, version='4.30')
    EMPTY_STACK_ID = 14
    ROWS = [6]*6


class Pegged7x7(Pegged6x6):
    __info__ = dict(id=184, name="Pegged 7x7", game_type=GT.PUZZLE_TYPE, version='4.30')
    ROWS = [7]*7


class PeggedTriangle5(Pegged):
    __info__ = dict(id=210, name="Pegged Triangle 1",
                    game_type=GT.PUZZLE_TYPE, version='4.60')
    STEPS = ((-2, -4), (-2, 4), (-4, 0), (4, 0), (2, -4), (2, 4))
    ROWS = range(1, 6)
    EMPTY_STACK_ID = 4


class PeggedTriangle6(PeggedTriangle5):
    __info__ = dict(id=211, name="Pegged Triangle 2",
                    game_type=GT.PUZZLE_TYPE, version='4.60')
    ROWS = range(1, 7)


PROVIDES = [Pegged, PeggedCross7, PeggedCross9, Pegged6x6, Pegged7x7,
            PeggedTriangle5, PeggedTriangle6]